﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using System.Collections.ObjectModel;

namespace TDUpdate
{
    public static class UpdateManager
    {
        public static UpdateComponentCollection UpdateComponentList { get { return UpdateManager.updateComponentList; } }
        public static GameTime GameTime { get { return UpdateManager.gameTime; } }
        public static IMouse Mouse { get; set; }

        static UpdateComponentCollection updateComponentList = new UpdateComponentCollection();
        static GameTime gameTime;

        public static void Update(GameTime gameTime)
        {
            UpdateManager.gameTime = gameTime;
            foreach (UpdateComponent component in UpdateManager.UpdateComponentList)
            {
                component.Update();
            }
        }

        public static void Start()
        {
            Level level = new Level();
            UpdateManager.UpdateComponentList.Add(level);

            // Da wir noch in der Entwicklung sind:
            DebugInformations info = new DebugInformations();
            UpdateManager.UpdateComponentList.Add(info);
        }
    }
}
